Inheritance diagram for TChannelDataBucket:

Public Member Functions | |
| TChannelDataBucket () | |
| TChannelDataBucket (TMCPixelBucket *pbuck) | |
| TMCPoint | GetOrigin (void) const |
| void | SetOrigin (const TMCPoint &p) |
| void * | GetPrivateData (void) const |
| void | SetPrivateData (void *data) |
| real32 | GetGamma (void) const |
| void | SetGamma (const real32 g) |
| TMCRect | OffsetRect (void) const |
Protected Attributes | |
| TMCPoint | fOrigin |
| origin of the pixelbucket | |
| void * | fPrivateData |
| private data used by MCImage channel API | |
| real32 | fGamma |
| gamma used to interpret 8-bit data | |
//allocate a memory block that will receive a copy of the channel's data //use a TMCArray as buffer so we get asserts if we go outside the bounds TMCArray<real> distanceBuffer; distanceBuffer.SetElemCount( (tileRect.GetWidth()+fMaxRadius*4) * (tileRect.GetHeight()+fMaxRadius*4) ); int32 rmax= fMaxRadius; TMCRect rect(outputRect.left-2*rmax,outputRect.top-2*rmax,outputRect.right+2*rmax,outputRect.bottom+2*rmax); //fZBuffer is a TMCCountedPtr <IShChannel> TChannelDataBucket distanceBucket; fZBuffer->GetData(rect, &distanceBucket,(void*)distanceBuffer.BaseAddress(), eTileRead | kDataReplicateBorders); const uint32 width = outputRect.GetWidth(); const uint32 height = outputRect.GetHeight(); real* dist= NULL; for (uint32 y= rmax; y < (height+3*rmax); y++) { dist= (real*)distanceBucket.RowPtr32(y); for (uint32 x= rmax; x < (width+3*rmax); x++) { // for each pixel in the buffer gShellThreadUtilities->YieldProcesses(15); const real pixelDistance= dist[x]; // Now do something with it... } } fZBuffer->UnGetData(&distanceBucket,false); //Don't forget this !!!!
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
gamma used to interpret 8-bit data
|
|
|
origin of the pixelbucket
|
|
|
private data used by MCImage channel API
|
1.4.5